#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
string s;
int a[N];
int sum[N];
struct node {
    int l, r;
    int minv;
    int add;
} tr[N * 4];
int n, m;
void pushup(int u) { tr[u].minv = min(tr[u << 1].minv, tr[u << 1 | 1].minv); }

void pushdown(int u) {
    if (tr[u].add) {
        tr[u << 1].add += tr[u].add;
        tr[u << 1 | 1].add += tr[u].add;
        tr[u << 1].minv += tr[u].add;
        tr[u << 1 | 1].minv += tr[u].add;
        tr[u].add = 0;
    }
}
void build(int u, int l, int r) {
    if (l == r) {
        tr[u] = {l, r};
        return;
    }
    tr[u].l = l, tr[u].r = r;
    int mid = l + r >> 1;
    build(u << 1, l, mid);
    build(u << 1 | 1, mid + 1, r);
    pushup(u);
}

void modify(int u, int l, int r, int x) {
    if (tr[u].l >= l && tr[u].r <= r) {
        tr[u].minv += x;
        tr[u].add += x;
        return;
    }
    pushdown(u);
    int mid = tr[u].l + tr[u].r >> 1;
    if (l <= mid) modify(u << 1, l, r, x);
    if (r > mid) modify(u << 1 | 1, l, r, x);
    pushup(u);
}

int query(int u, int l, int r) {
    if (l <= tr[u].l && tr[u].r <= r) {
        return tr[u].minv;
    }
    int mid = tr[u].l + tr[u].r >> 1;
    pushdown(u);
    int res = 1e9;
    if (l <= mid) res = min(res, query(u << 1, l, r));
    if (r > mid) res = min(res, query(u << 1 | 1, l, r));
    return res;
}

int main() {
    cin >> n >> m;
    cin >> s;
    int len = s.size();
    for (int i = 0; i < n; i++) {
        if (s[i] == '(')
            a[i + 1] = 1;
        else
            a[i + 1] = -1;
    }
    build(1, 1, n);
    for (int i = 1; i <= n; i++) {
        modify(1, i, n, a[i]);
    }

    while (m--) {
        int op, l, r;
        cin >> op >> l >> r;
        if (op == 1) {
            modify(1, l, n, -a[l]);
            modify(1, r, n, -a[r]);
            swap(a[l], a[r]);
            modify(1, l, n, a[l]);
            modify(1, r, n, a[r]);
        } else {
            int pre;
            if (l == 1)
                pre = 0;
            else
                pre = query(1, l - 1, l - 1);
            if (query(1, l, r) - pre == 0 && query(1, r, r) - pre == 0) {
                puts("Yes");
            } else
                puts("No");
        }
    }
}

